package join.util;

/**
 * Created by zhengjiasen on 2018/3/3.
 */
public class StringArrayUtil {

    public String[] getArray() {
        return array;
    }

    public void setArray(String[] array) {
        this.array = array;
    }

    private String[] array;

    public StringArrayUtil() {
    }

    public StringArrayUtil(String[] array) {
        this.array = array;
    }


    public String slice(int a, int b) throws ArrayIndexOutOfBoundsException {

        StringBuilder temp = new StringBuilder();

        for (int i = a; i < b; i++) {
            temp.append(this.array[i]);
            if ((i + 1) != b) {
                temp.append(",");
            }
        }
        return temp.toString();
    }

    public String slice(int a) {
        return this.slice(a, this.array.length);
    }


}
